package cn.iocoder.yudao.module.blog.dal.mysql.askresponse;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.blog.dal.dataobject.askresponse.BlogAskResponseDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.blog.controller.admin.askresponse.vo.*;

/**
 * 学员问题回复 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface BlogAskResponseMapper extends BaseMapperX<BlogAskResponseDO> {

    default PageResult<BlogAskResponseDO> selectPage(BlogAskResponsePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BlogAskResponseDO>()
                .eqIfPresent(BlogAskResponseDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(BlogAskResponseDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogAskResponseDO::getId));
    }

    default List<BlogAskResponseDO> selectList(BlogAskResponseExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BlogAskResponseDO>()
                .eqIfPresent(BlogAskResponseDO::getMobile, reqVO.getMobile())
                .betweenIfPresent(BlogAskResponseDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BlogAskResponseDO::getId));
    }

}
